#include "cmdhandler.h"
#include "manager.h"

namespace Config
{

CmdHandler::CmdHandler (Manager& _manager, QStringListIterator _cmdArgs)
{
    // Skip first argument: the program's name
    _cmdArgs.next();

    // Process every argument
    QString arg;
    while (_cmdArgs.hasNext())
    {
        arg = _cmdArgs.next();

        if (arg == "--scroll")
            _manager.m_UIType = Config::Core::UI_SCROLLVIEW;
        else if (arg == "--book")
            _manager.m_UIType = Config::Core::UI_BOOKVIEW;
        else
            throw UnknownCmdSwitchEx(arg);
    }
}

CmdHandler::~CmdHandler ()
{

}

}

